<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>质控审核-设备比对</title>
    <!-- jquery - boot -库文件 -->
    <script src="__PUBLIC__/script/jquery.1.11.1.js"></script>
    <script src="__PUBLIC__/script/bootstrap.min.js"></script>
    <!-- Bootstrap -->
    <link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet">
    <!-- Bootstrap -->
    <!-- font awesome -->
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/plugins/FontAwesome/css/font-awesome.min.css">
    <script src="__PUBLIC__/script/common.js"></script>
    <!--easyui包含文件-->
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/plugins/easyui1.5.3/themes/material/easyui.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/plugins/easyui1.5.3/themes/icon.css">
    <script type="text/javascript" src="__PUBLIC__/plugins/easyui1.5.3/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/plugins/easyui1.5.3/locale/easyui-lang-zh_CN.js"></script>
    <!--layer-->
    <script type="text/javascript" src="__PUBLIC__/plugins/layer/layer.js"></script>
    <!-- 自定义 css -->
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/reset.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/style.css">
    <!-- end easyui -->
    <!--图片放大镜-->
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/magnifier.css">
    <script type="text/javascript" src="__PUBLIC__/script/magnifier.js"></script>
    <!--图片放大镜-->
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="__PUBLIC__/script/html5shiv.js"></script>
    <script src="__PUBLIC__/script/respond.js"></script>
    <![endif]-->
</head>

<body>
    <include file="Public/header" />
    <!-- indexmain -->
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12 mainbox" id="mainbox">
                <!--menubegin-->
                <div class="datamenubox" id="leftmenu">
                    <div class="menuhead">退回整改</div>
                    <!-- treein -->
                    <div class="treein" id="menuin">
                        <ul class="list-group smenu">
                            <volist name="menulist" id="vo">
                                <a href="{:U($vo[url])}"><li class="list-group-item" id="{$vo.url}"><i class="fa fa-angle-right"></i>{$vo.name}</li></a>
                            </volist>
                        </ul>
                    </div>
                </div>
                <!--menuend-->
                <!--mainboxbegin-->
                <div class="col-md-12 rights" id="right">
                    <!-- 位置导航 -->
                    <ol class="breadcrumb">
                        <li class="active">首页</li>
                        <li class="active">退回整改</li>
                        <li class="active">设备比对</li>
                    </ol>
                    <!-- 筛选 -->
                    <div class="searchitem">
                        <div class="row">
                            <div class="col-md-12">
                                <input class="easyui-combobox" name="q_fzr" id="q_fzr" style="width:200px" data-options="label:'负责人：',valueField:'id',textField:'text',panelHeight:'180'">                       
                                <input class="easyui-combobox" name="q_qy" id="q_qy" style="width:200px" data-options="label:'企业：',valueField:'id',textField:'text',panelHeight:'180'">                        
                                <input class="easyui-combobox" name="q_zf" id="q_zf" style="width:200px" data-options="label:'站房：',valueField:'id',textField:'text',panelHeight:'180'">                          
                                <input class="easyui-combobox" name="q_lx" id="q_lx" style="width:200px" data-options="label:'类型：',valueField:'id',textField:'text',panelHeight:'180'"> 
                                <input class="easyui-combobox" name="q_zt" id="q_zt" style="width:200px" data-options="label:'状态：',valueField:'id',textField:'text',panelHeight:'180'">                          
                                <input class="easyui-datebox" name="q_zgsj" id="q_zgsj" style="width:200px" data-options="label:'整改时间：'">
                                <input class="easyui-datebox" name="q_scsj" id="q_scsj" style="width:200px" data-options="label:'上传时间：'">
                            </div>
                        </div>
                        <div class="blank10"></div>
                        <div class="row">
                            <div class="col-md-12">
                                <div class="btnin">
                                    <button class="btn btn-danger" id="querybtn">查询</button>
                                </div>
                            </div>
                        </div>
                        <!-- end 筛选 -->
                    </div>
                    <!-- listtable -->
                    <div>
                        <!-- gridview row -->
                        <table id="dg"></table>
                        <!-- end gridview row -->
                    </div>
                    <!--mainboxend-->
                </div>
            </div>
        </div>
        <!-- indexmain end -->
        <!-- modals -->
        <div id="w" class="easyui-window" title="设备比对退回整改" data-options="modal:true,closed:true" style="width:600px;height:500px;padding:15px;display:none;">
            <div class="row" id="piclist">
            </div>
            <!-- <div class="row" style="margin-top: 15px;">
                <div class="col-md-12">
                    <input class="easyui-textbox" name="bz" id="bz" style="width:450px" data-options="label:'备注：',required:true">
                    <a class="btn btn-info" id="submits">退回整改</a>&nbsp;
                </div>                                          
            </div> -->
            <div class="blank10"></div> 
            <input type="hidden" id="hidid" name="hidid" />
        </div>
        <!-- /.modal-content -->
    </div>
    <include file="Public/footer" />
    <script>
        $(document).ready(function() {
            //初始化页面
            $('#sbbd_thzg').addClass('on');
            loaddg();
            LoadDDL('q_qy','QY');
            LoadDDL('q_fzr','XCRY');
            LoadDDL('q_zf','ZF');
            LoadDDL('q_lx','LX');
            LoadDDL('q_zt','ZGZT');
        });
        //加载数据列表
        function loaddg() {
            $('#dg').datagrid({
                loadMsg: '正在查询，请稍后...',
                title: '双击查看照片',
                height: $(window).height() - 300,
                url: '{:U(\'querysbbd_thzg\')}',
                queryParams: {
                    fzr: $('#q_fzr').combobox('getValue'),
                    qy: $('#q_qy').combobox('getValue'),
                    zf: $('#q_zf').combobox('getValue'),
                    lx: $('#q_lx').combobox('getValue'),
                    zgsj: $('#q_zgsj').datebox('getValue'),
                    scsj: $('#q_scsj').datebox('getValue'),
                    zt: $('#q_zt').combobox('getValue')
                },
                nowrap: false,
                striped: true,
                collapsible: false,
                loadMsg: '正在加载，请稍后。。。',
                remoteSort: false,
                singleSelect: true,
                pageSize: 100,
                idField: 'id',
                pagination: true,
                rownumbers: true,
                pagination: true,
                pageNumber: 1,
                pageSize: 20,
                pageList: [20, 40, 80, 160],
                fitColumns: true,
                columns: [
                    [{
                        field: 'qymc',
                        title: '企业名称',
                        width: 100
                    }, {
                        field: 'zflx',
                        title: '站房类型',
                        width: 50
                    }, {
                        field: 'zfmc',
                        title: '站房名称',
                        width: 100
                    }, {
                        field: 'zllb',
                        title: '资料类别',
                        width: 50
                    }, {
                        field: 'btmc',
                        title: '资料标题',
                        width: 100
                    }, {
                        field: 'fzr',
                        title: '负责人',
                        width: 50
                    }, {
                        field: 'zgsj',
                        title: '整改时间',
                        width: 70
                    }, {
                        field: 'scsj',
                        title: '上传时间',
                        width: 70
                    }, {
                        field: 'dqdz',
                        title: '上传地址',
                        width: 120
                    }, {
                        field: 'ztmc',
                        title: '状态',
                        width: 50
                    }, {
                        field: 'bz',
                        title: '整改原因',
                        width: 50
                    }]
                ],
                onDblClickRow:function(index,row){
                    $('#w').window('open');
                    $('#piclist').html('');
                    document.getElementById("hidid").value = row.id;
                    loadphoto(row.id);
                }
            });
            $("#querybtn").click(function() {
                $('#dg').datagrid('load', {
                    "fzr": $('#q_fzr').combobox('getValue'),
                    "qy": $('#q_qy').combobox('getValue'),
                    "zf": $('#q_zf').combobox('getValue'),
                    "lx": $('#q_lx').combobox('getValue'),
                    "zgsj": $('#q_zgsj').datebox('getValue'),
                    "scsj": $('#q_scsj').datebox('getValue'),
                    "zt": $('#q_zt').combobox('getValue')
                });
            });
        }

        //加载拍照图片
        function loadphoto(id){
            var html='';
            var option = {
                type: "POST",
                url: "{:U('queryphoto_thzg')}",
                data: {id:id},
                success: function (data) {
                    for(var i=0;i<data.length;i++){
                        html+='<div class="col-md-3" style="margin-top: 3px;"><a href="'+data[i]['img_path']+'" target="_blank"><img src="'+data[i]['img_path']+'"  style="width: 130px;height: 150px;"/></a></div>';
                    }
                    $('#piclist').html(html);
                }
            };
            $.ajax(option);
        }

        //退回整改
        // $('#submits').click(function(){
        //     var id=document.getElementById("hidid").value;
        //     var bz=$('#bz').textbox('getValue');
        //     var option = {
        //         type: "POST",
        //         url: "{:U('thzg')}",
        //         data: {id:id,bz:bz},
        //         success: function (data) {
        //             layer.closeAll();
        //             layer.msg(data);
        //             $("#querybtn").click();
        //         }
        //     };
        //     $.ajax(option);
        // })
    </script>
</body>

</html>